#! /usr/bin/python
# coding: utf-8

from Tkinter import *

root = Tk()

def printCoords(event):
    print 'event.char=', event.char
    print 'event.keycode=', event.keycode

bt1 = Button(root, text='Press a')
bt1.bind('<a>', printCoords)

bt2 = Button(root, text='Press <Space>')
bt2.bind('<space>', printCoords)

bt3 = Button(root, text='less than key')
bt3.bind('<less>', printCoords)

bt4 = Button(root, text='less than key')
bt4.bind('<multi>', printCoords)

bt1.focus_set()
bt1.grid()
bt2.grid()
bt3.grid()
bt4.grid()

root.mainloop()
